﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:aero="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
                    xmlns:converters="clr-namespace:Client.Converters"
                    >
    <!--Dark side background-->
    <LinearGradientBrush x:Key="NewPageBackground" StartPoint="0,0" EndPoint="1,1">
        <GradientStop Offset="1" Color="CornflowerBlue"/>
        <GradientStop Offset="0" Color="FloralWhite"/>
    </LinearGradientBrush>

    <!--Light side background-->
    <LinearGradientBrush x:Key="LightSideBackground" StartPoint="1,0" EndPoint="1,1">
        <GradientStop Offset="0" Color="LightBlue"/>
        <GradientStop Offset="1" Color="WhiteSmoke"/>
    </LinearGradientBrush>

    <!-- Background -->
    <SolidColorBrush x:Key="BaseColor" Color="#5E72F7"></SolidColorBrush>
    <!--textbox color-->
    <SolidColorBrush x:Key="TextBoxBase" Color="#5F82F5"></SolidColorBrush>

    <!-- Glass -->
    <LinearGradientBrush x:Key="GlassFX" StartPoint=".5,0" EndPoint=".5,.5">
        <GradientStop Offset="0" Color="#33DDDDDD"></GradientStop>
        <GradientStop Offset="1" Color="#33000000"></GradientStop>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="GlassFXDisabled" StartPoint=".5,0" EndPoint=".5,.5">
        <GradientStop Offset="0" Color="AliceBlue"></GradientStop>
        <GradientStop Offset="1" Color="#11000000"></GradientStop>
    </LinearGradientBrush>

    <!-- Glow FX-->
    <RadialGradientBrush x:Key="GlowFX" GradientOrigin=".5,1" Center=".5,1">
        <GradientStop Offset="0" Color="#990000FF"></GradientStop>
        <GradientStop Offset=".5" Color="#660000DD"></GradientStop>
        <GradientStop Offset="1" Color="#33000000"></GradientStop>
    </RadialGradientBrush>
    <RadialGradientBrush x:Key="GlowFXPressed" GradientOrigin=".5,1" Center=".5,1">
        <GradientStop Offset="0" Color="#660000CC"></GradientStop>
        <GradientStop Offset="1.2" Color="#33FFFFFF"></GradientStop>
    </RadialGradientBrush>
    <LinearGradientBrush x:Key="GlowFXRowPressed">
        <GradientStop Offset="0" Color="#660000FF"></GradientStop>
        <GradientStop Offset=".7" Color="#660000AA"></GradientStop>
        <GradientStop Offset="1" Color="#66000000"></GradientStop>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="GlowFXProgress">
        <GradientStop Offset="0" Color="#660099FF"></GradientStop>
        <GradientStop Offset=".99" Color="#660022AA"></GradientStop>
        <GradientStop Offset="1" Color="#00000000"></GradientStop>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="GlowFXProgressAnimated" MappingMode="RelativeToBoundingBox">
        <GradientStop Offset="0" Color="#00000000"></GradientStop>
        <GradientStop Offset=".50" Color="#660099FF"></GradientStop>
        <GradientStop Offset="1" Color="#00000000"></GradientStop>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="GlowFXTabSelected" StartPoint=".5,1" EndPoint=".5,0">
        <GradientStop Offset="0" Color="#33DDDDDD"></GradientStop>
        <GradientStop Offset="1" Color="#332222FF"></GradientStop>
    </LinearGradientBrush>

    <!-- Glow -->
    <Storyboard x:Key="GlowOut">
        <DoubleAnimation x:Name="AnimGlowOut" BeginTime="00:00:00" Storyboard.TargetName="GlowRectangle" Duration="00:00:00.250" From="1" To="0" Storyboard.TargetProperty="Opacity"></DoubleAnimation>
    </Storyboard>
    <Storyboard x:Key="GlowIn">
        <DoubleAnimation x:Name="AnimGlow" BeginTime="00:00:00" Storyboard.TargetName="GlowRectangle" Duration="00:00:00.250" From="0" To="1" Storyboard.TargetProperty="Opacity">
        </DoubleAnimation>
    </Storyboard>

    <!--Window control-->
    <!--TODO - Window title-->
    <!--<ControlTemplate x:Key="WindowControlTemplate" TargetType="{x:Type Window}">
            <Binding Path="CurrentPageViewModel.Name" Converter="{StaticResource titleConverter}"/>
    </ControlTemplate>-->

    <!--Listview properties-->

    <LinearGradientBrush x:Key="BackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FF6FBDE8" Offset="0"/>
                <GradientStop Color="#FF4385BE" Offset="1"/>
            </GradientStopCollection>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="HighlightBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FF97d3f3" Offset="0"/>
                <GradientStop Color="#FF4385BE" Offset="1"/>
            </GradientStopCollection>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="BorderBrush" StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFAFDDF6" Offset="0"/>
                <GradientStop Color="#FF2969AA" Offset="1"/>
            </GradientStopCollection>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FF75aac7" Offset="0"/>
                <GradientStop Color="#FF143c65" Offset="1"/>
            </GradientStopCollection>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

    <Style x:Key="GridViewColumnHeaderGripper" TargetType="Thumb">
        <Setter Property="Width" Value="14"/>
        <Setter Property="Background" Value="#2e566b"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}" Background="Transparent">
                        <Rectangle HorizontalAlignment="Center" Width="1" Fill="{TemplateBinding Background}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type GridViewColumnHeader}" TargetType="GridViewColumnHeader">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="#FFFFFF" />
        <Setter Property="Padding" Value="8"/>
        <Setter Property="FontSize" Value="18" />
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GridViewColumnHeader">
                    <Grid>
                        <Border Name="HeaderBorder" Padding="{TemplateBinding Padding}" BorderThickness="0,1,0,1" BorderBrush="{StaticResource BorderBrush}" Background="{StaticResource BackgroundBrush}">
                            <ContentPresenter Name="HeaderContent" Margin="0,0,0,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Border>
                        <Thumb x:Name="PART_HeaderGripper" HorizontalAlignment="Right" Margin="0,0,-9,0" Style="{StaticResource GridViewColumnHeaderGripper}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="HeaderBorder" Property="Background" Value="{StaticResource HighlightBackgroundBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="HeaderBorder" Property="Background" Value="{StaticResource PressedBorderBrush}"/>
                            <Setter TargetName="HeaderContent" Property="Margin" Value="1,1,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Role" Value="Floating">
                <Setter Property="Opacity" Value="0.7"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Canvas Name="PART_FloatingHeaderCanvas">
                                <Rectangle Fill="#60000000" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"/>
                            </Canvas>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Role" Value="Padding">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="GridViewColumnHeader">
                            <Border Name="HeaderBorder" BorderThickness="0,1,0,1" BorderBrush="{StaticResource BorderBrush}" Background="{StaticResource BackgroundBrush}"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>


    <!--ListViewStyle-->
    <Style x:Key="ListViewItemContainerStyle" TargetType="{x:Type ListViewItem}">
        <Setter Property="Background" Value="#ffffff" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="Margin" Value="0,0,0,0" />
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListViewItem}">
                    <Border x:Name="Bd" Background="{TemplateBinding Background}" SnapsToDevicePixels="true" BorderThickness="0,0,0,1" BorderBrush="#6FBDE8">
                        <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected"  Value="true">
                            <Setter TargetName="Bd" Property="BorderBrush" Value="#FF143c65" />
                            <Setter Property="Background" TargetName="Bd">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStopCollection>
                                                <GradientStop Color="#FF75aac7" Offset="0"/>
                                                <GradientStop Color="#FF143c65" Offset="1"/>
                                            </GradientStopCollection>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Bd" Property="Background" Value="#F5BA56" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true" />
                                <Condition Property="Selector.IsSelectionActive" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" TargetName="Bd">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStopCollection>
                                                <GradientStop Color="#FF75aac7" Offset="0"/>
                                                <GradientStop Color="#FF143c65" Offset="1"/>
                                            </GradientStopCollection>
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" TargetName="Bd" Value="#FF143c65"/>
                            <Setter Property="Foreground" Value="White"/>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Scroller-->

    <Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}" TargetType="ScrollViewer">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <DockPanel Margin="{TemplateBinding Padding}">
                            <ScrollViewer DockPanel.Dock="Top" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Focusable="false">
                                <GridViewHeaderRowPresenter Margin="0,0,0,0" Columns="{Binding Path=TemplatedParent.View.Columns,
											RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderContainerStyle="{Binding Path=TemplatedParent.View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource TemplatedParent}}" 
											ColumnHeaderTemplate="{Binding Path=TemplatedParent.View.ColumnHeaderTemplate,RelativeSource={RelativeSource TemplatedParent}}" 
											ColumnHeaderTemplateSelector="{Binding Path=TemplatedParent.View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}" 
											AllowsColumnReorder="{Binding Path=TemplatedParent.View.AllowsColumnReorder, RelativeSource={RelativeSource TemplatedParent}}"
											ColumnHeaderContextMenu="{Binding Path=TemplatedParent.View.ColumnHeaderContextMenu, RelativeSource={RelativeSource TemplatedParent}}" 
											ColumnHeaderToolTip="{Binding Path=TemplatedParent.View.ColumnHeaderToolTip, RelativeSource={RelativeSource TemplatedParent}}" 
											SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </ScrollViewer>
                            <ScrollContentPresenter Name="PART_ScrollContentPresenter"
											KeyboardNavigation.DirectionalNavigation="Local"
											CanContentScroll="True" CanHorizontallyScroll="False" 
											CanVerticallyScroll="False"/>
                        </DockPanel>
                        <ScrollBar Name="PART_HorizontalScrollBar" Orientation="Horizontal" Grid.Row="1" Maximum="{TemplateBinding ScrollableWidth}" ViewportSize="{TemplateBinding ViewportWidth}" Value="{TemplateBinding HorizontalOffset}" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
                        <ScrollBar Name="PART_VerticalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" ViewportSize="{TemplateBinding ViewportHeight}" Value="{TemplateBinding VerticalOffset}" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--ListView-->

    <Style x:Key="{x:Type ListView}" TargetType="ListView">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FontSize" Value="18"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListView">
                    <Border Name="Border" BorderThickness="1" BorderBrush="#999999" Background="#DFDFDF">
                        <ScrollViewer Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}">
                            <ItemsPresenter />
                        </ScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--ListBox-->
    <!--<Image Source="Images/home.png" />-->

    <DataTemplate x:Key="listBoxTemplate">
        <StackPanel Height="80" Width="160" Orientation="Horizontal">
            <Border Margin="10,5,0,0" Height="32" Width="32" VerticalAlignment="Center">
                <Image Source="{Binding Icon}" />
            </Border>
        </StackPanel>
    </DataTemplate>

    <!--ListBoxItem-->
    <Style x:Key="{x:Type ListBoxItem}" TargetType="ListBoxItem">
        <Setter Property="Margin" Value="10,10,10,0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Grid>
                        <Button  Content="{Binding Name}"
                                 Command="{Binding DataContext.CommandToSwitch, RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
                                 CommandParameter="{Binding }"/>
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="true">
                <Setter Property="Background" Value="RoyalBlue" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--button-->
    <Style TargetType="{x:Type Button}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="FontSize" Value="18" />
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate x:Name="tmpltButton">
                    <Grid>
                        <Border x:Name="BaseRectangle" 
                                    Background="{StaticResource BaseColor}" 
                                    CornerRadius="10,10,10,10">
                        </Border>
                        <Border x:Name="GlassRectangle" 
                                    Background="{StaticResource GlassFX}" 
                                    CornerRadius="10,10,10,10">
                        </Border>
                        <Border x:Name="GlowRectangle" 
                                    Background="{StaticResource GlowFX}" 
                                    CornerRadius="10,10,10,10" 
                                    Opacity="0">
                        </Border>
                        <Border x:Name="ButtonBorder" 
                                    CornerRadius="10,10,10,10" 
                                    BorderBrush="Black" 
                                    Opacity="1"  
                                    BorderThickness="1">
                        </Border>
                        <ContentPresenter x:Name="ButtonContent" 
                                              Opacity=".7" 
                                              Content="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}}" 
                                              HorizontalAlignment="center" 
                                              VerticalAlignment="center"
                                          >
                        </ContentPresenter>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <EventTrigger RoutedEvent="Button.MouseLeave">
                            <EventTrigger.Actions>
                                <BeginStoryboard Storyboard="{StaticResource GlowOut}"></BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="Button.MouseEnter">
                            <EventTrigger.Actions>
                                <BeginStoryboard Storyboard="{StaticResource GlowIn}"></BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="Button.LostFocus">
                            <EventTrigger.Actions>
                                <BeginStoryboard Storyboard="{StaticResource GlowOut}"></BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="Button.GotFocus">
                            <EventTrigger.Actions>
                                <BeginStoryboard Storyboard="{StaticResource GlowIn}"></BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                        <Trigger Property="Button.IsPressed" Value="True">
                            <Setter Property="Background" TargetName="GlowRectangle" Value="{StaticResource GlowFXPressed}"></Setter>
                            <Setter Property="Opacity" TargetName="ButtonContent" Value="1"></Setter>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" TargetName="ButtonContent" Value=".3"></Setter>
                            <Setter Property="Opacity" TargetName="ButtonBorder" Value=".5"></Setter>
                            <Setter Property="Background" TargetName="GlassRectangle" Value="{StaticResource GlassFXDisabled}"></Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!-- Combo -->
    <ControlTemplate x:Key="cmbToggleButton" TargetType="ToggleButton">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition Width="20"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Rectangle x:Name="BaseRectangle" Fill="{StaticResource BaseColor}" RadiusX="3" RadiusY="3" Grid.ColumnSpan="2"></Rectangle>
            <Rectangle x:Name="GlowRectangle" RadiusX="5" RadiusY="5" Opacity="0" Fill="{StaticResource GlowFX}" Grid.Column="0"></Rectangle>
            <Border  x:Name="Border" Grid.ColumnSpan="2" Background="{StaticResource GlassFX}" BorderBrush="Black" BorderThickness="1" CornerRadius="3" />
            <Border Grid.Column="0" CornerRadius="3,0,0,3" Margin="1" Background="{StaticResource GlassFX}" BorderBrush="DarkBlue"  BorderThickness="0,0,1,0" />
            <Path x:Name="Arrow" Grid.Column="1" Fill="Cyan" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 4 4 L 8 0 Z"/>
        </Grid>
        <ControlTemplate.Triggers>
            <EventTrigger RoutedEvent="ToggleButton.MouseLeave">
                <EventTrigger.Actions>
                    <BeginStoryboard Storyboard="{StaticResource GlowOut}"></BeginStoryboard>
                </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger RoutedEvent="ToggleButton.MouseEnter">
                <EventTrigger.Actions>
                    <BeginStoryboard Storyboard="{StaticResource GlowIn}"></BeginStoryboard>
                </EventTrigger.Actions>
            </EventTrigger>
            <Trigger Property="ToggleButton.IsChecked" Value="true">
                <Setter TargetName="Border" Property="Background" Value="{StaticResource GlowFXPressed}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" TargetName="Border" Value=".3"></Setter>
                <Setter Property="Opacity" TargetName="Arrow" Value=".5"></Setter>
                <Setter Property="Background" TargetName="Border" Value="{StaticResource GlassFXDisabled}"></Setter>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox">
        <Border x:Name="PART_ContentHost" Focusable="False" Background="Transparent" />
    </ControlTemplate>
    <Style TargetType="{x:Type ComboBox}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"></Setter>
        <Setter Property="Foreground" Value="White" />
        <Setter Property="FontSize" Value="18"/>
        <Setter Property="FontStyle" Value="Italic"/>
        <Setter Property="FontStretch" Value="ExtraExpanded"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate x:Name="tmplTextBox" TargetType="ComboBox">
                    <Grid>
                        <ToggleButton Name="ToggleButton" Template="{StaticResource cmbToggleButton}" Grid.Column="2" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press">
                        </ToggleButton>
                        <ContentPresenter
            Name="ContentSite"
            IsHitTestVisible="False" 
            Content="{TemplateBinding SelectionBoxItem}"
            ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
            ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
            Margin="3,3,23,3"
            VerticalAlignment="Center"
            HorizontalAlignment="Center" />

                        <TextBox x:Name="PART_EditableTextBox" FontSize="25" HorizontalAlignment="Stretch" Foreground="White" VerticalAlignment="Stretch" Margin="1,1,23,1" Focusable="True" Visibility="Hidden" IsReadOnly="{TemplateBinding ComboBox.IsReadOnly}"/>
                        <Popup Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding ComboBox.IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Slide">
                            <Grid Name="DropDown" SnapsToDevicePixels="True" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding ComboBox.MaxDropDownHeight}">
                                <Rectangle x:Name="BaseRectangle" Fill="#99000000" RadiusX="3" RadiusY="3" Grid.ColumnSpan="2"></Rectangle>
                                <Border x:Name="DropDownBorder" Background="{StaticResource GlassFX}" BorderThickness="1" BorderBrush="DarkBlue" CornerRadius="3"/>
                                <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
                                    <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasItems" Value="false">
                            <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource GlassFXDisabled}"/>
                        </Trigger>
                        <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
                            <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4"/>
                            <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!-- txtbox -->
    <Style TargetType="{x:Type TextBox}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Margin" Value="5,2,5,2"/>
        <Setter Property="Height" Value="30"/>
        <Setter Property="FontSize" Value="16"/>
        <Setter Property="FontWeight" Value="Medium"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate x:Name="tmpltTextBox">
                    <Grid>
                        <Rectangle x:Name="BaseRectangle" Fill="{StaticResource TextBoxBase}" RadiusX="3" RadiusY="3"></Rectangle>
                        <Rectangle x:Name="GlassRectangle" RadiusX="5" RadiusY="5" Fill="{StaticResource GlassFX}"></Rectangle>
                        <Rectangle x:Name="GlowRectangle" RadiusX="5" RadiusY="5" Opacity="0" Fill="{StaticResource GlowFX}"></Rectangle>
                        <Border x:Name="BorderIntern" Opacity="1" BorderBrush="Black" BorderThickness="2" CornerRadius="3" Margin="1,1,-1,-1"></Border>
                        <Border x:Name="BorderExtern" Opacity="1" BorderBrush="#FF333333" BorderThickness="1" CornerRadius="3"></Border>
                        <ScrollViewer x:Name="PART_ContentHost" Opacity=".8" Content="{Binding Path=Content, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="{Binding Path=HorizontalAlignment, RelativeSource={RelativeSource TemplatedParent}}" 
                                      VerticalAlignment="{Binding Path=VerticalAlignment, RelativeSource={RelativeSource TemplatedParent}}" 
                                      Width="{Binding Path=Width, RelativeSource={RelativeSource TemplatedParent}}" Height="{Binding Path=Height, RelativeSource={RelativeSource TemplatedParent}}"></ScrollViewer>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <EventTrigger RoutedEvent="TextBox.LostFocus">
                            <EventTrigger.Actions>
                                <BeginStoryboard Storyboard="{StaticResource GlowOut}"></BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="TextBox.GotFocus">
                            <EventTrigger.Actions>
                                <BeginStoryboard Storyboard="{StaticResource GlowIn}"></BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" TargetName="PART_ContentHost" Value=".3"></Setter>
                            <Setter Property="Opacity" TargetName="BorderExtern" Value=".5"></Setter>
                            <Setter Property="Fill" TargetName="GlassRectangle" Value="{StaticResource GlassFXDisabled}"></Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="_border" TargetType="{x:Type Border}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="BorderBrush" Value="{StaticResource BaseColor}"/>
        <Setter Property="BorderThickness" Value="6,6,6,6"/>
        <Setter Property="CornerRadius" Value="40,40,40,40"/>
    </Style>


    <!--<Style TargetType="{x:Type TextBlock}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="FontSize" Value="16"/>
        <Setter Property="FontFamily" Value="Sagoe UI"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
    </Style>-->


    <ControlTemplate x:Key="ValidationTemplate1">
        <DockPanel LastChildFill="True">
            <Border DockPanel.Dock="Top"  BorderBrush="Red" BorderThickness="1" CornerRadius="4,4,0,0" 
                    HorizontalAlignment="Right" Margin="0,0,5,0">
                <Border.Background>
                    <SolidColorBrush Color="Red" />
                </Border.Background>
                <TextBlock Text="{Binding ElementName=txtField, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}"
                       Background="Transparent" FontSize="12" Foreground="White" Padding="10,0,3,0" Height="16" VerticalAlignment="Center"/>
            </Border>
            <Border DockPanel.Dock="Bottom" BorderBrush="Red" BorderThickness="3" CornerRadius="4">
                <AdornedElementPlaceholder Name="txtField" />
            </Border>
        </DockPanel>
    </ControlTemplate>


    <Style TargetType="{x:Type TabItem}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid Name="grdTab" Margin="1,0,0,0" Height="20">
                        <Border Name="BaseBorder" Margin="0,0,-4,0" Background="{StaticResource BaseColor}" CornerRadius="2,12,0,0" Height="20"></Border>
                        <Border Name="Border" Margin="0,0,-4,0" Background="{StaticResource GlassFX}" BorderBrush="Black"  BorderThickness="1,1,1,1" CornerRadius="2,12,0,0" Height="20" >
                            <Grid  Margin="12,2,12,2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"></ColumnDefinition>
                                    <ColumnDefinition Width="10"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <ContentPresenter x:Name="ContentSite" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True" Height="20"/>
                            </Grid>
                        </Border>
                        <Border x:Name="GlowRectangle" Margin="0,0,-4,0" CornerRadius="2,12,0,0" Opacity="0" Background="{StaticResource GlowFX}" Height="20"></Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value=".5" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Background" TargetName="Border" Value="{StaticResource GlowFXTabSelected}" />
                        </Trigger>
                        <EventTrigger RoutedEvent="MouseLeave">
                            <EventTrigger.Actions>
                                <BeginStoryboard Storyboard="{StaticResource GlowOut}"></BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                        <EventTrigger RoutedEvent="MouseEnter">
                            <EventTrigger.Actions>
                                <BeginStoryboard Storyboard="{StaticResource GlowIn}"></BeginStoryboard>
                            </EventTrigger.Actions>
                        </EventTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style  TargetType="{x:Type TabControl}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="3"></ColumnDefinition>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                            <ColumnDefinition Width="3"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <TabPanel Name="HeaderPanel" Grid.Row="0" Panel.ZIndex="1" Grid.Column="1"  Margin="0,0,4,-1" IsItemsHost="True" KeyboardNavigation.TabIndex="1" Background="Transparent" />
                        <Border Name="BaseBorder" Grid.Row="1" Grid.ColumnSpan="2" Background="{StaticResource BaseColor}"  BorderBrush="Black" BorderThickness="1" CornerRadius="5"></Border>
                        <Border Name="Border" Grid.Row="1" Grid.ColumnSpan="2" Background="{StaticResource LightSideBackground}"  BorderBrush="Black" BorderThickness="1" CornerRadius="5" 
                                KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" Opacity="1" >
                            <ContentPresenter Name="PART_SelectedContentHost" Margin="4" ContentSource="SelectedContent"/>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value=".5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>